package com.test;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewTreeObserver;

public class MoreLineButton extends View {
	private int width;
	private boolean tag = false;

	public MoreLineButton(Context context) {
		super(context);
		// width = this.getMeasuredWidth();
		ViewTreeObserver vto = getViewTreeObserver();
		vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {

			public boolean onPreDraw() {
				if (tag == false) {
					width = getMeasuredWidth();
					tag=true;
				}
				return true;
			}
		});
	}

	public MoreLineButton(Context context, AttributeSet attr) {
		super(context, attr);
	}
	

	public void addButton(String[] arr) {
		System.out.println(width);
	}
}
